{% extends "FOSUserBundle:Registration:register.html.twig" %}

{% block head %}
{{parent()}}
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
	<meta http-equiv="refresh" content="1; url={{path('cadss_test_homepage')}}" />
	<script type="text/javascript">
            window.location.href = "{{path('cadss_test_homepage')}}"
    </script>
{% endif %}
{% endblock head %}

{% block fos_user_content %}
		{#
			{% for user in users %}
				<p>{{ user.id }} {{ user.username }} {{ user.email }}</p>
		#}	
		{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}	
			<div class="toast">	{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }}
				<img src="{{ asset('img/close.png') }}" witdh="16" height="16" onclick="this.parentNode.style.display='none'"/>
			</div>
		{% else %}
			{% for error in form.vars.errors %}
                <div class="toast">{{ error.message }}<img src="{{ asset('img/close.png') }}" witdh="16" height="16" onclick="this.parentNode.style.display='none'"/></div>
            {% endfor %}    
                
        {% endif %}
        		
		<div id="dragme" class="login unselectable">	
		{{ form_start(form) }}               
        <table>
            <tr><td>{{ form_label(form.username) }}</td><td>{{ form_widget(form.username) }}</td></tr>
            <tr><td>{{ form_label(form.email) }}</td><td>{{ form_widget(form.email) }}</td> </tr>
            <tr><td>{{ form_label(form.plainPassword.first) }}</td><td>{{ form_widget(form.plainPassword.first) }}</td>   </tr>
            <tr><td>{{ form_label(form.plainPassword.second) }}</td><td>{{ form_widget(form.plainPassword.second) }}</td>   </tr>
           
            <tr><td colspan="2"><input type="submit" value="{{ 'registration.submit'|trans({}, 'FOSUserBundle') }}" /></td> </tr>			
			<tr><td colspan="2" id="register"><a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'FOSUserBundle')|lower }}</a></td></tr>
			</table>		  
        {{ form_row(form._token) }}       
		{{ form_end(form) }}				
			
		
		</div>
	
{% endblock fos_user_content %}





